/**
 * ...
 * @author Yog
 */

package cookinmaddy.database.spod;

import cookinmaddy.model.Unit;

class DBUnit extends php.db.Object
{	
	public var value : Unit;
	
	public var uni_id : Int;
	public var uni_name : String;
	public var uni_longname : String;
	static var TABLE_NAME = "unit";
	static var TABLE_IDS = ["uni_id"];
	static var PRIVATE_FIELDS = ["value"];
	
	public static var DROP_REQUEST = "drop table " + TABLE_NAME + ";";
	public static var CREATION_REQUEST_V1 = "create table " + TABLE_NAME + " " +
	"( " +
		"uni_id integer autoincrement not null primary key," +
		"uni_name varchar(15) not null," +
		"uni_longname  varchar(60) not null" +
	");";	
	public static var INITIALIZATION_REQUEST_V1 = "insert into " + TABLE_NAME + " " +
	"(" +
		"uni_name," +
		"uni_longname" +
	") VALUES (" + 
		"'l', " + 
		"'Litre'" +	
	");";
	
	//public static var manager = new php.db.Manager<DBUnit>(DBUnit);   	
	public static var manager = new DBUnitManager();   	
}